<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@page contentType="text/html" %>
<html>
<script type="text/javascript" src="<c:url value="/static/js/thirdparty/jquery.html5uploader.js"/>"></script>
<head>
<title>Upload a file please</title>
<script type="text/javascript">
var url = '<c:url value="/upload-file"/>';
$( function(){
	$("#dropbox, #fileupload").html5Uploader({
		name: "foo",
		postUrl: url	
	});	 
});

function uploadProgress(evt) {
	  if (evt.lengthComputable) {
	    var percentComplete = Math.round(evt.loaded * 100 / evt.total);
	    document.getElementById('progressNumber').innerHTML = percentComplete.toString() + '%';
	  }
	  else {
	    document.getElementById('progressNumber').innerHTML = 'unable to compute';
	  }
	}
  
</script>
</head>
<body>
<h1>Please upload a file</h1>
<input type="file" name="file" id="fileupload"/>
<div id="dropbox" style="width: 300px; height: 300px; border: solid"></div>
</body>
</html>